package cn.hxzy.ownerSource.service.impl;

import cn.hxzy.common.Result;
import cn.hxzy.entity.sourceEntity.SourceOperation;
import cn.hxzy.ownerSource.mapper.SourceOperationMapper;
import cn.hxzy.ownerSource.service.SourceOperationService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author ao.Li
 * @since 2023-06-23
 */
@Service
public class SourceOperationServiceImpl extends ServiceImpl<SourceOperationMapper, SourceOperation> implements SourceOperationService {

    @Autowired
    private SourceOperationMapper sourceOperationMapper;

    //新增操作记录
    @Override
    public Result addOper(SourceOperation sourceOperation) {
        if (sourceOperation!=null){
            int insert = sourceOperationMapper.insert(sourceOperation);
            if (insert>0) return Result.ok().message("新增成功！");
        }
        return Result.error().message("新增失败！");
    }
}
